import React from 'react';//react的核心库
import ReactDOM from 'react-dom/client';//react专门操作dom的核心库
import reportWebVitals from './reportWebVitals';
//react定义组件可以通过函数或者类来定义组件
import App from './App';
import { BrowserRouter as Router } from 'react-router-dom';
//创建渲染的容器
const root = ReactDOM.createRoot(
  document.getElementById('root') as HTMLElement
);
//将组件渲染到root容器中
//组件在react中,所有首字母必须大写
//首字母大写解析成组件,小写解析成html元素
root.render(
  <Router>
    <App />
  </Router>
);


// If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log))
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
reportWebVitals();
